﻿using Microsoft.Extensions.DependencyInjection;

namespace PmSoft.FileStorage;

public static class FileStorageCollectionExtensions
{
    public static IServiceCollection AddFileStorage(this IServiceCollection services)
    {
        if (services == null)
        {
            throw new ArgumentNullException(nameof(services));
        }

        services.AddOptions<MinIoOptions>();
        services.AddSingleton<IFileStorage, MinIoStorage>();

        return services;
    }
}
